<script lang="ts">
  import type { TabularData } from '@mathesar/stores/table-data';
  import RecordSummaryConfig from '@mathesar/systems/table-view/table-inspector/record-summary/RecordSummaryConfig.svelte';

  import { getTableRecordId } from './utils';

  export let tabularData: TabularData;

  $: ({ table, processedColumns, recordsData, selection, isLoading } =
    tabularData);
  $: ({ selectableRowsMap } = recordsData);
  $: previewRecordId = getTableRecordId({
    processedColumns: $processedColumns,
    selection: $selection,
    selectableRowsMap: $selectableRowsMap,
  });
</script>

<RecordSummaryConfig
  {table}
  processedColumns={$processedColumns}
  {previewRecordId}
  isLoading={$isLoading}
/>
